import request from '@/utils/request'

// 获取班级对应用户列表
export const getUserListByClassIdListService = (userTypeId: number, classIdList: number[]) => {
	// 构造参数，以至于后端能解析
	const params = new URLSearchParams()
	params.append('userTypeId', userTypeId.toString())
	classIdList.forEach((classId) => params.append('classIdList', classId.toString()))

	return request.get(`/public/UserClassname/userList`, { params })
}

// 获取用户对应的班级信息
export const getClassListByUserIdService = (userId: number) =>
	request.get(`/public/UserClassname/classList?userId=${userId}`)
